package com.example.dormlist.service;

import com.example.dormlist.entity.DormitoryBuilding;
import com.example.dormlist.repo.DormitoryBuildingRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@AllArgsConstructor
public class DormitoryBuildingService {
    private final DormitoryBuildingRepository dormitoryBuildingRepository;

    public List<DormitoryBuilding> findAll() {
        return dormitoryBuildingRepository.findAll();
    }
    public DormitoryBuilding findBuildingById(Long buildingId) {
        return dormitoryBuildingRepository.getById(buildingId);
    }
}
